package com.qunarmei.netty;

import io.netty.channel.Channel;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.group.ChannelGroup;
import io.netty.channel.group.DefaultChannelGroup;
import io.netty.util.concurrent.GlobalEventExecutor;

import java.util.Date;
import java.util.concurrent.ConcurrentHashMap;

/**
 * ClassName:Global
 * Function: TODO ADD FUNCTION.
 * @author hxy
 */
public class Global {

    public static ChannelGroup group = new DefaultChannelGroup(GlobalEventExecutor.INSTANCE);

    public static ConcurrentHashMap<ChannelHandlerContext,ClientInfor> allinfor =new ConcurrentHashMap<>(4096); //减少map扩容次数



    public static class ClientInfor{
        Date time;
        String content;
        ChannelHandlerContext ctx;

        public ClientInfor(Date time, String content ,  ChannelHandlerContext ctx ) {
            this.time = time;
            this.content = content;
            this.ctx =ctx;
        }
    }

}